﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Interop.UIAutomationCore;
using UIAControls;
using System.Windows.Automation;

namespace LEETCustomPatterns
{
    public class RotationPattern : CustomClientInstanceBase, IRotationPattern 
    {
        public static AutomationPattern Pattern{ get { 
            return AutomationPattern.LookupById(RotatePatternSchema.Instance.PatternId); 
        } }

        public RotationPattern(IUIAutomationPatternInstance patternInstance)
            : base(patternInstance) {}

        public int CurrentRotation
        {
            get { return (int)GetCurrentPropertyValue(RotatePatternSchema.Instance.RotationProperty); }
        }

        public int CachedRotation
        {
            get { return (int)GetCachedPropertyValue(RotatePatternSchema.Instance.RotationProperty); }
        }

        public void SetRotation(int value)
        {
            CallMethod(RotatePatternSchema.Instance.SetRotationMethod, value);
        }
    }
}
